﻿using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


public class MoreContentButton : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        SetUpMoreContent();
    }

    private void SetUpMoreContent() => GetComponentInChildren<Button>().onClick.AddListener(ContentTextMore_Btn);

    //内容文本 更多按钮
    public void ContentTextMore_Btn()
    {
        AppUIManager.instance.currentPanel = AppUIManager.CurrentPanelType.OpenAContentText;
        Transform contentTextPanel = GameObject.FindGameObjectWithTag("ContentTextPanel").transform;
        contentTextPanel.Find("Panel").localPosition = Vector2.zero;
        contentTextPanel.Find("Panel").gameObject.SetActive(true);
        contentTextPanel.Find("Panel/Scroll View/Viewport/Content/Text").GetComponent<Text>().DOText(transform.parent.GetComponent<Text>().text, 1.2F);
        Invoke("ChangePanelType_2", 0.25F);
    }

    private void ChangePanelType_2()
    {
        AppUIManager.instance.agoPanel = AppUIManager.CurrentPanelType.OpenAContentText;
    }
}
